/*
 * GetUserAction.java
 *
 * Created on 10 de noviembre de 2007, 18:37
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package webportlet.model.portletfacade.plain.action;

import java.sql.Connection;
import webportlet.model.usuario.dao.SQLUsuarioDAO;
import webportlet.model.usuario.dao.SQLUsuarioDAOFactory;
import webportlet.model.util.InstanceNotFoundException;
import webportlet.model.util.InternalErrorException;
import webportlet.model.util.NonTransactionalPlainAction;

/**
 *
 * @author Alvarete
 */
public class GetUsuarioAction implements NonTransactionalPlainAction {

    private String nickName;
    
    public GetUsuarioAction(String nickName) {
        this.nickName = nickName;
    }
    
    public Object execute(Connection connection) 
        throws InstanceNotFoundException, InternalErrorException {
                
        SQLUsuarioDAO usuarioDAO = SQLUsuarioDAOFactory.getDAO();
            
        return usuarioDAO.find(connection, nickName);                

    }
}